home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / newrouts / newrouts.cls < prev    next >
Text File  |  1997-06-13  |  2KB  |  61 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "NewRout"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. Attribute VB_Description = "New Routine Assist by Michael J. Cox"
  9. Option Explicit
  10.  
  11. Dim myMainMenuItem As Object
  12. Dim ConnectID As Long
  13.  
  14. Dim Add_A_Routine As clsAddARoutine
  15.  
  16. Sub ConnectAddin(VBInstance As Object)
  17.     '**************************************
  18.     '* Author : Michael J. Cox
  19.     '* Date : 6/13/97
  20.     '* Email : mikec247@ix.netcom.com
  21.     '*
  22.     '* Desc:
  23.     '*   When the Addin is checked in the
  24.     '*   Addin manager this module is called.
  25.     '*   This routine adds the menu to the
  26.     '*   VB IDE menu.
  27.     '***********************************
  28.     On Error GoTo EH
  29.     
  30.     Set gobjVBInst = VBInstance
  31.     Set Add_A_Routine = New clsAddARoutine
  32.     Set myMainMenuItem = gobjVBInst.AddInMenu.MenuItems.Add("Add a &New Routine...")
  33.     
  34.     ConnectID = myMainMenuItem.ConnectEvents(Add_A_Routine)
  35.     Exit Sub
  36. EH:
  37.     MsgBox Err.Description
  38.     Exit Sub
  39. End Sub
  40.  
  41. Sub DisConnectAddin(mode As Integer)
  42.     '**************************************
  43.     '* Author : Michael J. Cox
  44.     '* Date : 6/13/97
  45.     '* Email : mikec247@ix.netcom.com
  46.     '*
  47.     '* Desc:
  48.     '*   When the Addin is unchecked in the
  49.     '*   Addin manager this module is called.
  50.     '*   This routine removes the menu to the
  51.     '*   VB IDE menu.
  52.     '***********************************
  53.     
  54.     'unhook menu items from class objects----------------
  55.     myMainMenuItem.DisconnectEvents ConnectID
  56.  
  57.     'remove main menu------------------------------------
  58.     gobjVBInst.AddInMenu.MenuItems.Remove myMainMenuItem
  59. End Sub
  60.  
  61.